C Sharp
snippet | |
---|---|
alter table student ADD gpa DECIMAL(3, 2); | |
update student set name = "bonny" where student_id = 2 | |
CREATE TABLE student ( student_id INT, name VARCHAR(20) NOT NULL, major VARCHAR(20), PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student(student_id, name) VALUES(3, \"bob\"); | |
CREATE TABLE student ( student_id INT, name VARCHAR(20), major VARCHAR(20) UNIQUE, PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student(student_id, name) VALUES(3, \"bob\"); | |
CREATE TABLE student ( student_id INT, name VARCHAR(20) NOT NULL, major VARCHAR(20), PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student(student_id, name) VALUES(3, \"bob\"); | |
CREATE TABLE student ( student_id INT, name VARCHAR(20), major VARCHAR(20) UNIQUE, PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student(student_id, name) VALUES(3, \"bob\"); | |
ALTER TABLE myassac ADD FULLTEXT (title); | |
# description to stranger # 1. column average # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. SELECT AVG(reminders) AS average FROM daily_routines_times; | |
# description to stranger # 1. column round average # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. SELECT ROUND(AVG(reminders) ,0) AS \"average\" FROM daily_routines_times; | |
pushd C:wamp64inmysqlmysql5.7.26in mysqldump -u root -p counts_2 bbb > wantedsqlfile.sql | |
pushd C:wamp64inmysqlmysql5.7.26in> mysql -u root -p counts_2 < aaa.sql | |
INSERT INTO sleep(year) SELECT year FROM blank | |
INSERT INTO Destination SELECT * FROM Source; | |
# description to stranger # 1. # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT count(*) FROM information_schema.columns WHERE table_schema = 'counts_2' AND table_name = 'aaa'; | |
CREATE TABLE student ( student_id INT, name VARCHAR(20), major VARCHAR(20), PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student(student_id, name) VALUES(3, \"bob\"); | |
CREATE TABLE student ( student_id INT, name VARCHAR(20), major VARCHAR(20), PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student VALUES(1, \"bob\", \"biology\"); INSERT INTO student VALUES(2, \"bib\", \"chemistry\"); | |
# description to stranger # 1. # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT count(*) FROM information_schema.columns WHERE table_schema = 'counts_2' AND table_name = 'aaa'; | |
# description to stranger # 1. count rows in table # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT COUNT(*) FROM cities; | |
CREATE TABLE if not exists counts_4." + display_box_1.Text + "(`id` int(11) AUTO_INCREMENT, date varchar(30) DEFAULT 'xxx', amount int DEFAULT 0, PRIMARY KEY(`id`)) | |
CREATE TABLE student ( student_id INT PRIMARY KEY, name VARCHAR(20), major VARCHAR(20) ); | |
CREATE TABLE student ( student_id INT, name VARCHAR(20), major VARCHAR(20), PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student(student_id, name) VALUES(3, \"bob\"); | |
delete from student | |
ALTER TABLE database1.test1 DROP COLUMN test; | |
alter table student DROP COLUMN gpa; | |
drop table student; CREATE TABLE student ( student_id INT auto_increment, name VARCHAR(20), major VARCHAR(20) default 'undecided', PRIMARY KEY(student_id) ); INSERT INTO student(name) VALUES("bob"); INSERT INTO student(name) VALUES("bob2"); INSERT INTO student(name) VALUES("alen"); select * from student; SELECT name, major FROM student order by name DESC ; | |
CREATE TABLE employee ( emp_id INT PRIMARY KEY, first_name VARCHAR(40), last_name VARCHAR(40), birth_day DATE, sex VARCHAR(1), salary INT, super_id INT, branch_id INT ); CREATE TABLE branch ( branch_id INT PRIMARY KEY, branch_name VARCHAR(40), mgr_id INT, mgr_start_date DATE, FOREIGN KEY(mgr_id) REFERENCES employee(emp_id) ON DELETE SET NULL ); ALTER TABLE employee ADD FOREIGN KEY(branch_id) REFERENCES branch(branch_id) ON DELETE SET NULL; ALTER TABLE employee ADD FOREIGN KEY(super_id) REFERENCES employee(emp_id) ON DELETE SET NULL; CREATE TABLE client ( client_id INT PRIMARY KEY, client_name VARCHAR(40), branch_id INT, FOREIGN KEY(branch_id) REFERENCES branch(branch_id) ON DELETE SET NULL ); CREATE TABLE works_with ( emp_id INT, client_id INT, total_sales INT, PRIMARY KEY(emp_id, client_id), FOREIGN KEY(emp_id) REFERENCES employee(emp_id) ON DELETE CASCADE, FOREIGN KEY(client_id) REFERENCES client(client_id) ON DELETE CASCADE ); CREATE TABLE branch_supplier ( branch_id INT, supplier_name VARCHAR(40), supply_type VARCHAR(40), PRIMARY KEY(branch_id, supplier_name), FOREIGN KEY(branch_id) REFERENCES branch(branch_id) ON DELETE CASCADE ); -- ----------------------------------------------------------------------------- -- Corporate INSERT INTO employee VALUES(100, 'David', 'Wallace', '1967-11-17', 'M', 250000, NULL, NULL); INSERT INTO branch VALUES(1, 'Corporate', 100, '2006-02-09'); UPDATE employee SET branch_id = 1 WHERE emp_id = 100; INSERT INTO employee VALUES(101, 'Jan', 'Levinson', '1961-05-11', 'F', 110000, 100, 1); -- Scranton INSERT INTO employee VALUES(102, 'Michael', 'Scott', '1964-03-15', 'M', 75000, 100, NULL); INSERT INTO branch VALUES(2, 'Scranton', 102, '1992-04-06'); UPDATE employee SET branch_id = 2 WHERE emp_id = 102; INSERT INTO employee VALUES(103, 'Angela', 'Martin', '1971-06-25', 'F', 63000, 102, 2); INSERT INTO employee VALUES(104, 'Kelly', 'Kapoor', '1980-02-05', 'F', 55000, 102, 2); INSERT INTO employee VALUES(105, 'Stanley', 'Hudson', '1958-02-19', 'M', 69000, 102, 2); -- Stamford INSERT INTO employee VALUES(106, 'Josh', 'Porter', '1969-09-05', 'M', 78000, 100, NULL); INSERT INTO branch VALUES(3, 'Stamford', 106, '1998-02-13'); UPDATE employee SET branch_id = 3 WHERE emp_id = 106; INSERT INTO employee VALUES(107, 'Andy', 'Bernard', '1973-07-22', 'M', 65000, 106, 3); INSERT INTO employee VALUES(108, 'Jim', 'Halpert', '1978-10-01', 'M', 71000, 106, 3); -- BRANCH SUPPLIER INSERT INTO branch_supplier VALUES(2, 'Hammer Mill', 'Paper'); INSERT INTO branch_supplier VALUES(2, 'Uni-ball', 'Writing Utensils'); INSERT INTO branch_supplier VALUES(3, 'Patriot Paper', 'Paper'); INSERT INTO branch_supplier VALUES(2, 'J.T. Forms & Labels', 'Custom Forms'); INSERT INTO branch_supplier VALUES(3, 'Uni-ball', 'Writing Utensils'); INSERT INTO branch_supplier VALUES(3, 'Hammer Mill', 'Paper'); INSERT INTO branch_supplier VALUES(3, 'Stamford Lables', 'Custom Forms'); -- CLIENT INSERT INTO client VALUES(400, 'Dunmore Highschool', 2); INSERT INTO client VALUES(401, 'Lackawana Country', 2); INSERT INTO client VALUES(402, 'FedEx', 3); INSERT INTO client VALUES(403, 'John Daly Law, LLC', 3); INSERT INTO client VALUES(404, 'Scranton Whitepages', 2); INSERT INTO client VALUES(405, 'Times Newspaper', 3); INSERT INTO client VALUES(406, 'FedEx', 2); -- WORKS_WITH INSERT INTO works_with VALUES(105, 400, 55000); INSERT INTO works_with VALUES(102, 401, 267000); INSERT INTO works_with VALUES(108, 402, 22500); INSERT INTO works_with VALUES(107, 403, 5000); INSERT INTO works_with VALUES(108, 403, 12000); INSERT INTO works_with VALUES(105, 404, 33000); INSERT INTO works_with VALUES(107, 405, 26000); INSERT INTO works_with VALUES(102, 406, 15000); INSERT INTO works_with VALUES(105, 406, 130000); | |
Globals.myConn_2.Open(); string query = "TRUNCATE TABLE nadavroc_personal_website.aaa"; MySqlCommand cmd = new MySqlCommand(query, Globals.myConn_2); cmd.ExecuteNonQuery(); Globals.myConn_2.Close(); | |
drop table student; | |
CREATE TABLE student2 ( student_number INT, name VARCHAR(20), major VARCHAR(20), PRIMARY KEY(student_number) ); DESCRIBE student2; | |
CREATE TABLE student ( student_id INT, name VARCHAR(20) NOT NULL, major VARCHAR(20), PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student(student_id, name) VALUES(3, \"bob\"); | |
CREATE TABLE student ( student_id INT, name VARCHAR(20), major VARCHAR(20) UNIQUE, PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student(student_id, name) VALUES(3, \"bob\"); | |
String myfinalstring = cell.Replace("apostraphe", double quote"); | |
// description to stranger // 1. insert vlaue into table // 2. // 3. // running condtions: // 1. meant ot run intside button flick in user form in visual studio // 2. table and data bases as named // 3. using MySql.Data.MySqlClient; insertQuery = "INSERT INTO database1.diary(`id`, `category`, `title`, `entry`, `rating`, `date`) VALUES(NULL,'" + diary_category_box.Text + "','" + diary_title_box.Text + "','" + MySql.Data.MySqlClient.MySqlHelper.EscapeString(new_wit_box.Text) + "','" + new_wit_rating_box.Text + "','" + today + "'); "; | |
# description to stranger # 1. # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT * INTO OUTFILE 'e:/mysqldump.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\' LINES TERMINATED BY ' ' FROM eyes_creation_steps | |
# description to stranger # 1. # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT * INTO OUTFILE 'e:/mysqldump.sql' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\' LINES TERMINATED BY ' ' FROM eyes_creation_steps | |
select round(AVG(amount)) FROM diligence_points_per_day WHERE SUBSTRING(date, 7, 4) = '2022' | |
// description to stranger // 1. get biggest line count of a filre in folders and sub folders // 2. // 3. // running condtions: // 1. meant ot run intside button flick in user form in visual studio DirectoryInfo objDirectoryInfo = new DirectoryInfo(@"C:Usersmr bigDropboxcode hroughout renderextend scriptactive tested multi renders"); FileInfo[] allFiles = objDirectoryInfo.GetFiles("*.jsx", SearchOption.AllDirectories); List foreach (var file in allFiles) { var lineCount = File.ReadLines(file.FullName).Count(); file_lines_counts_list.Add(lineCount); } // MessageBox.Show(string.Join(Environment.NewLine, c_sharp_snippets_content_list)); MessageBox.Show((file_lines_counts_list.Max()).ToString()); | |
// description to stranger // 1. get biggest number in list // 2. // 3. // running condtions: // 1. meant ot run intside button flick in user form in visual studio DirectoryInfo objDirectoryInfo = new DirectoryInfo(@"C:Usersmr bigDropboxcode hroughout renderextend scriptactive tested multi renders"); FileInfo[] allFiles = objDirectoryInfo.GetFiles("*.jsx", SearchOption.AllDirectories); List foreach (var file in allFiles) { var lineCount = File.ReadLines(file.FullName).Count(); file_lines_counts_list.Add(lineCount); } // MessageBox.Show(string.Join(Environment.NewLine, c_sharp_snippets_content_list)); MessageBox.Show((file_lines_counts_list.Max()).ToString()); | |
// description to stranger // 1. get biggest number in list // 2. // 3. // running condtions: // 1. meant ot run intside button flick in user form in visual studio DirectoryInfo objDirectoryInfo = new DirectoryInfo(@"C:Usersmr bigDropboxcode hroughout renderextend scriptactive tested multi renders"); FileInfo[] allFiles = objDirectoryInfo.GetFiles("*.jsx", SearchOption.AllDirectories); List foreach (var file in allFiles) { var lineCount = File.ReadLines(file.FullName).Count(); file_lines_counts_list.Add(lineCount); } // MessageBox.Show(string.Join(Environment.NewLine, c_sharp_snippets_content_list)); MessageBox.Show((file_lines_counts_list.Max()).ToString()); | |
# description to stranger # 1. get bottom value in column by id column # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4.auto incrementing id column # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT date FROM daily_routines_times ORDER BY id DESC LIMIT 1; | |
selectQuery1 = "SELECT data_type from information_schema.columns where table_schema = + add_column_database_box.Text + and table_name = + tables_list_2[ii] + AND COLUMN_NAME = + add_columns_column_1_name_box.Text + "; | |
selectQuery1 = "SELECT Column_Default from information_schema.columns where table_schema = + add_column_database_box.Text + and table_name = + tables_list_2[ii] + AND COLUMN_NAME = + add_columns_column_1_name_box.Text + "; | |
selectQuery1 = "SELECT CHARACTER_MAXIMUM_LENGTH from information_schema.columns where table_schema = + add_column_database_box.Text + and table_name = + tables_list_2[ii] + AND COLUMN_NAME = + add_columns_column_1_name_box.Text + "; | |
SELECT COLUMN_NAME FROM information_schema.columns WHERE TABLE_SCHEMA = 'database1' AND TABLE_NAME = 'back_up' AND ORDINAL_POSITION = 1; | |
# description to stranger # 1. get bottom value in column by id column # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4.auto incrementing id column # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT date FROM daily_routines_times ORDER BY id DESC LIMIT 1; | |
SELECT Column_Default FROM Information_Schema.Columns WHERE Table_Schema = 'tasks' AND Table_Name = 'all_tasks' AND Column_Name = 'title' | |
# description to stranger # 1. get first instance in column # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT id FROM daily_routines_times where counts =13 LIMIT 1 | |
# description to stranger # 1. get first instance in column # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT id FROM daily_routines_times where counts =13 LIMIT 1 | |
# description to stranger # 1. get first value in column # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT counts FROM daily_routines_times LIMIT 1 | |
# description to stranger # 1. get first value in column # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT counts FROM daily_routines_times LIMIT 1 | |
# description to stranger # 1. get id of last id where another column value is less than 1 # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. SELECT id FROM posttimerconstantprogress WHERE extra_minutes < 1 ORDER BY id DESC LIMIT 1; | |
# description to stranger # 1. get id of last id where another column value is less than 1 # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. SELECT id FROM posttimerconstantprogress WHERE extra_minutes < 1 ORDER BY id DESC LIMIT 1; | |
money_connection.Open(); try { sqlite_cmd = money_connection.CreateCommand(); sqlite_cmd.CommandText = "SELECT c.name FROM pragma_table_info(singlequoteexpansessinglequote) c"; ; using (var reader = sqlite_cmd.ExecuteReader()) { while (reader.Read()) { columns_list.Add(reader["name"].ToString()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { money_connection.Close(); } | |
# description to stranger # 1. get max value in column # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. SELECT MAX(step_number) FROM counts_2.model_creation_steps | |
drop table student; CREATE TABLE student ( student_id INT auto_increment, name VARCHAR(20), major VARCHAR(20) default 'undecided', PRIMARY KEY(student_id) ); INSERT INTO student(name) VALUES("bob"); INSERT INTO student(name) VALUES("bob2"); select * from student; SELECT name, major FROM student; | |
# description to stranger # 1. # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - LOAD DATA LOCAL INFILE 'e:/mysqldump.sql' INTO TABLE new_table IGNORE 1 LINES; | |
# description to stranger # 1. list columns # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. Show columns from daily_routines_times | |
# description to stranger # 1. column round average # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. SELECT ROUND(AVG(reminders) ,0) AS \"average\" FROM daily_routines_times; | |
CREATE TABLE student ( student_id INT, name VARCHAR(20), major VARCHAR(20), PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student VALUES(1, \"bob\", \"biology\"); INSERT INTO student VALUES(2, \"bib\", \"chemistry\"); | |
# description to stranger # 1. insert new row setting one value # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. all column not inserted to need a default such as null # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - INSERT INTO database1.dailyroutinestimes (`date`) VALUES("11.9.2019"); | |
# description to stranger # 1. insert new rows withought specifiying columns names # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4.auoti incrment id at start # 5. # 6. # 7. INSERT INTO previously_seen_movies (`id`) VALUES (NULL); | |
CREATE TABLE student ( student_id INT, name VARCHAR(20), major VARCHAR(20), PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student(student_id, name) VALUES(3, \"bob\"); | |
CREATE TABLE student ( student_id INT, name VARCHAR(20), major VARCHAR(20), PRIMARY KEY(student_id) ); DESCRIBE student; INSERT INTO student VALUES(1, \"bob\", \"biology\"); | |
drop table student; CREATE TABLE student ( student_id INT auto_increment, name VARCHAR(20), major VARCHAR(20) default 'undecided', PRIMARY KEY(student_id) ); INSERT INTO student(name) VALUES("bob"); INSERT INTO student(name) VALUES("bob"); INSERT INTO student(name) VALUES("alen"); select * from student; SELECT * FROM student where name like '%b' ; | |
# description to stranger # 1. join tables of same column by value in specific column # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. SELECT title FROM deadlines where frequency =1 UNION ALL SELECT title FROM sleep where frequency =1 UNION ALL SELECT title FROM happiness where frequency =1 | |
# description to stranger # 1. join tables of same column by value in specific column # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. SELECT title FROM deadlines where frequency =1 UNION ALL SELECT title FROM sleep where frequency =1 UNION ALL SELECT title FROM happiness where frequency =1 | |
create table employee ( emp_id int PRIMARY KEY, first_name VARCHAR(40), last_name VARCHAR(40), birth_day DATE, sex VARCHAR(1), salary INT, super_id INT, branch_id INT ); create table branch ( branch_id INT PRIMARY KEY, branch_name VARCHAR(40), mgr_id INT, mgr_start_date DATE, FOREIGN KEY(mgr_id) REFERENCES employee(emp_id) ON DELETE SET NULL ); ALTER TABLE employee ADD FOREIGN KEY(branch_id) REFERENCES branch(branch_id) ON DELETE SET NULL; ALTER TABLE employee ADD FOREIGN KEY(super_id) REFERENCES employee(emp_id) ON DELETE SET NULL; | |
# description to stranger # 1. list columns # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. Show columns from daily_routines_times | |
create table employee ( emp_id int PRIMARY KEY, first_name VARCHAR(40), last_name VARCHAR(40), birth_day DATE, sex VARCHAR(1), salary INT, super_id INT, branch_id INT ); create table branch ( branch_id INT PRIMARY KEY, branch_name VARCHAR(40), mgr_id INT, mgr_start_date DATE, FOREIGN KEY(mgr_id) REFERENCES employee(emp_id) ON DELETE SET NULL ); ALTER TABLE employee ADD FOREIGN KEY(branch_id) REFERENCES branch(branch_id) ON DELETE SET NULL; ALTER TABLE employee ADD FOREIGN KEY(super_id) REFERENCES employee(emp_id) ON DELETE SET NULL; | |
CREATE TABLE student ( student_id INT, name VARCHAR(20), major VARCHAR(20), PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student VALUES(1, \"bob\", \"biology\"); | |
create table employee ( emp_id int PRIMARY KEY, first_name VARCHAR(40), last_name VARCHAR(40), birth_day DATE, sex VARCHAR(1), salary INT, super_id INT, branch_id INT ); create table branch ( branch_id INT PRIMARY KEY, branch_name VARCHAR(40), mgr_id INT, mgr_start_date DATE, FOREIGN KEY(mgr_id) REFERENCES employee(emp_id) ON DELETE SET NULL ); ALTER TABLE employee ADD FOREIGN KEY(branch_id) REFERENCES branch(branch_id) ON DELETE SET NULL; ALTER TABLE employee ADD FOREIGN KEY(super_id) REFERENCES employee(emp_id) ON DELETE SET NULL; | |
create table employee ( emp_id int PRIMARY KEY, first_name VARCHAR(40), last_name VARCHAR(40), birth_day DATE, sex VARCHAR(1), salary INT, super_id INT, branch_id INT ); create table branch ( branch_id INT PRIMARY KEY, branch_name VARCHAR(40), mgr_id INT, mgr_start_date DATE, FOREIGN KEY(mgr_id) REFERENCES employee(emp_id) ON DELETE SET NULL ); ALTER TABLE employee ADD FOREIGN KEY(branch_id) REFERENCES branch(branch_id) ON DELETE SET NULL; ALTER TABLE employee ADD FOREIGN KEY(super_id) REFERENCES employee(emp_id) ON DELETE SET NULL; | |
CREATE TABLE student ( student_id INT, name VARCHAR(20), major VARCHAR(20), PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student VALUES(1, \"bob\", \"biology\"); | |
insertQuery4 = "ALTER TABLE " + add_column_database_box.Text + "." + tables_list_2[ii] + " MODIFY " + add_columns_column_1_name_box.Text + " " + column_type + "(" + column_length + ") NOT NULL DEFAULT + column_default + AFTER " + previous_column + ""; | |
insertQuery4 = "ALTER TABLE " + add_column_database_box.Text + "." + tables_list_2[ii] + " MODIFY " + add_columns_column_1_name_box.Text + " " + column_type + "(" + column_length + ") NOT NULL DEFAULT +column_default+ FIRST"; | |
create table employee ( emp_id int PRIMARY KEY, first_name VARCHAR(40), last_name VARCHAR(40), birth_day DATE, sex VARCHAR(1), salary INT, super_id INT, branch_id INT ); create table branch ( branch_id INT PRIMARY KEY, branch_name VARCHAR(40), mgr_id INT, mgr_start_date DATE, FOREIGN KEY(mgr_id) REFERENCES employee(emp_id) ON DELETE SET NULL ); ALTER TABLE employee ADD FOREIGN KEY(branch_id) REFERENCES branch(branch_id) ON DELETE SET NULL; ALTER TABLE employee ADD FOREIGN KEY(super_id) REFERENCES employee(emp_id) ON DELETE SET NULL; | |
CREATE TABLE student ( student_id INT, name VARCHAR(20), major VARCHAR(20), PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student VALUES(1, \"bob\", \"biology\"); | |
CREATE TABLE student ( student_id INT, name VARCHAR(20), major VARCHAR(20), PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student VALUES(3, \"bob\", null); | |
# description to stranger # 1. update increment # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. UPDATE test2 SET test= (test+1) where id = 5 | |
# description to stranger # 1. random from column # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. SELECT movie FROM previously_seen_movies ORDER BY RAND() LIMIT 1 | |
# description to stranger # 1. replace character in cell # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. UPDATE `test2` SET `test`= REPLACE(test,'$','/') WHERE id = 1 | |
# description to stranger # 1. replace character in cell # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. UPDATE `test2` SET `test`= REPLACE(test,'$','/') WHERE id = 1 | |
// description to stranger // 1. replace character in string // 2. // 3. // running condtions: // 1. meant ot run intside button flick in user form in visual studio c_sharp_snippets_content = c_sharp_snippets_content.Replace('/', '$'); | |
// description to stranger // 1. replace character in string // 2. // 3. // running condtions: // 1. meant ot run intside button flick in user form in visual studio c_sharp_snippets_content = c_sharp_snippets_content.Replace('/', '$'); | |
// description to stranger // 1. replace wordin string // 2. // 3. // running condtions: // 1. meant ot run intside button flick in user form in visual studio c_sharp_snippets_content = c_sharp_snippets_content.Replace("//", "$$"); | |
// description to stranger // 1. replace wordin string // 2. // 3. // running condtions: // 1. meant ot run intside button flick in user form in visual studio c_sharp_snippets_content = c_sharp_snippets_content.Replace("//", "$$"); | |
CREATE TABLE student2 ( student_number INT, name VARCHAR(20), major VARCHAR(20), PRIMARY KEY(student_number) ); | |
# description to stranger # 1. return unique values from column # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. SELECT DISTINCT Country FROM Customers; | |
SELECT id FROM database1.calendar where task_1 like '%stdio text box%' | |
SELECT question FROM test WHERE MATCH (question) AGAINST ('mass'); | |
# description to stranger # 1. secondary order # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT * FROM `tasks_designation` order by designated_order asc, urgency_rating desc | |
# description to stranger # 1. secondary order # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT * FROM `tasks_designation` order by designated_order asc, urgency_rating desc | |
# description to stranger # 1. # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT * FROM `the_feed` WHERE date_2 <= CURRENT_DATE() | |
# description to stranger # 1. select first instance in column # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. SELECT id FROM `history_1` WHERE answer_1_abrev = 'xxx' limit 1 | |
# description to stranger # 1. select from last row # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified select *from getLastRecord ORDER BY id DESC LIMIT 1 | |
# description to stranger # 1. select minimum value # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. minimumu out of numerical column SELECT MIN(answer_1_score) AS 'answer_1_score' from memorization.history_1 | |
# description to stranger # 1. select minimum value # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. minimumu out of numerical column SELECT MIN(answer_1_score) AS 'answer_1_score' from memorization.history_1 | |
# description to stranger # 1. select one value where another value is the minimum # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. minimum out of numerical column SELECT * FROM memorization.history_1 WHERE answer_1_score = ( SELECT MIN(answer_1_score) FROM memorization.history_1 ) | |
# description to stranger # 1. select one value where another value is the minimum # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. minimum out of numerical column SELECT * FROM memorization.history_1 WHERE answer_1_score = ( SELECT MIN(answer_1_score) FROM memorization.history_1 ) | |
# description to stranger # 1. select several specific columns # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. SELECT name, birth FROM pet; | |
SELECT * FROM `in_day_diligence` WHERE subcategory_2 LIKE 'not_yet%' | |
# description to stranger # 1. select values based on whether one of the values in row is the minimum select id FROM memorization.history_1 WHERE answer_1_score = (SELECT min( least(answer_1_score ,answer_2_score ) ) from history_1) | |
# description to stranger # 1. select values based on whether one of the values in row is the minimum select id FROM memorization.history_1 WHERE answer_1_score = (SELECT min( least(answer_1_score ,answer_2_score ) ) from history_1) | |
# description to stranger # 1. update increment # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. UPDATE test2 SET test= (test+1) where id = 5 | |
# description to stranger # 1. update increment # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. UPDATE test2 SET test= (test+1) where id = 5 | |
create table employee ( emp_id int PRIMARY KEY, first_name VARCHAR(40), last_name VARCHAR(40), birth_day DATE, sex VARCHAR(1), salary INT, super_id INT, branch_id INT ); create table branch ( branch_id INT PRIMARY KEY, branch_name VARCHAR(40), mgr_id INT, mgr_start_date DATE, FOREIGN KEY(mgr_id) REFERENCES employee(emp_id) ON DELETE SET NULL ); ALTER TABLE employee ADD FOREIGN KEY(branch_id) REFERENCES branch(branch_id) ON DELETE SET NULL; ALTER TABLE employee ADD FOREIGN KEY(super_id) REFERENCES employee(emp_id) ON DELETE SET NULL; | |
# description to stranger # 1. show all tables # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. string selectQuery1 = "show tables from database1"; | |
CREATE TABLE student ( student_id INT, name VARCHAR(20), major VARCHAR(20), PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student VALUES(1, \"bob\", \"biology\"); | |
CREATE TABLE student ( student_id INT, name VARCHAR(20), major VARCHAR(20), PRIMARY KEY(student_id) ); DESCRIBE student; SELECT * FROM student; INSERT INTO student VALUES(3, \"bob\", null); | |
# description to stranger # 1. sum column # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. SELECT SUM(reminders) FROM daily_routines_times; | |
# description to stranger # 1. sum column SELECT SUM(expected_points) AS expected_points FROM expected_diligence_points; | |
money_connection.Open(); try { sqlite_cmd = money_connection.CreateCommand(); sqlite_cmd.CommandText = "SELECT c.name FROM pragma_table_info(singlequoteexpansessinglequote) c"; ; using (var reader = sqlite_cmd.ExecuteReader()) { while (reader.Read()) { columns_list.Add(reader["name"].ToString()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { money_connection.Close(); } for(ii = 0;ii < columns_list.Count; ii++){ if (columns_list[ii] != "id" && columns_list[ii] != "sum" && columns_list[ii] != "month") { columns_list_2.Add(columns_list[ii]); } } money_connection.Open(); try { sqlite_cmd = money_connection.CreateCommand(); sqlite_cmd.CommandText = "SELECT count(*) from expanses where month <>singlequotexxxsinglequote"; ; using (var reader = sqlite_cmd.ExecuteReader()) { while (reader.Read()) { total_rows = Int32.Parse(reader["count(*)"].ToString()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { money_connection.Close(); } for (ii = 1; ii <= total_rows; ii++) { sum = 0; for (jj = 0; jj < columns_list_2.Count; jj++) { money_connection.Open(); try { sqlite_cmd = money_connection.CreateCommand(); sqlite_cmd.CommandText = "SELECT " + columns_list_2[jj] + " from expanses where id=" + ii + ";"; using (var reader = sqlite_cmd.ExecuteReader()) { while (reader.Read()) { sum = sum+ Int32.Parse(reader[columns_list_2[jj]].ToString()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { money_connection.Close(); } } money_connection.Open(); try { var cmd = new SQLiteCommand(money_connection); cmd.CommandText = "update expanses set sum =" + sum + " where id =" + ii + ";"; cmd.Prepare(); cmd.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { money_connection.Close(); } } | |
# description to stranger # 1. column average # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. SELECT AVG(reminders) AS average FROM daily_routines_times; | |
# description to stranger # 1. sum column # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. SELECT SUM(reminders) FROM daily_routines_times; | |
# description to stranger # 1. # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT sum(free_eye_upload) FROM (SELECT free_eye_upload FROM database1.daily_routines_times ORDER BY id DESC LIMIT 7) t1 | |
# description to stranger # 1. # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - SELECT sum(free_eye_upload) FROM (SELECT free_eye_upload FROM database1.daily_routines_times ORDER BY id DESC LIMIT 7) t1 | |
CREATE TABLE student2 ( student_number INT, name VARCHAR(20), major VARCHAR(20), PRIMARY KEY(student_number) ); | |
SELECT count(*) AS TOTALNUMBEROFTABLES FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'counts_3' | |
// description to stranger // 1. union all tables in data base where column equals // 2. // 3. // running condtions: // 1. meant ot run intside button flick in user form in visual studio // 2. table and data bases as named // 3. using MySql.Data.MySqlClient; try { // store all tables of data base in list // ./. // assign varaible to connection string myConnection = "datasource=localhost;port=3306;username=root;password=''"; // conncet by varaible MySqlConnection myConn = new MySqlConnection(myConnection); // assign varaible to reading from data base MySqlDataReader mdr; // open connection myConn.Open(); List // command string string selectQuery1 = "show tables from counts"; // execute commadnt to select quary MySqlCommand SelectCommand = new MySqlCommand(selectQuery1, myConn); // assign varaible to reader of fethcing quary mdr = SelectCommand.ExecuteReader(); // assign value feteched to text box while (mdr.Read()) { tables_list.Add(mdr.GetString("Tables_in_counts")); } // close connection myConn.Close(); // /./ string query_join_tables_1 = "SELECT `title`, `conduct`, `count`, `level`, `days_since_placed`, `table_name` FROM counts."; string query_join_tables_2 = " where frequency = 1 UNION ALL "; string query_join_tables_3 = ""; // gets lists lengths int tables_list_length = tables_list.Count; // loop add to combox box for (int i = 0; i < tables_list_length-1; i++) { query_join_tables_3 = query_join_tables_3 + query_join_tables_1 + tables_list[i] + query_join_tables_2; } query_join_tables_3 = query_join_tables_3 + query_join_tables_1 + tables_list[tables_list_length - 1] + " where frequency = 1"; MySqlDataAdapter sqlda = new MySqlDataAdapter(query_join_tables_3, myConn); DataTable data_table_1 = new DataTable(); sqlda.Fill(data_table_1); grid_1.DataSource = data_table_1; // close connection myConn.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } | |
# description to stranger # 1. update a value in last row by id # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - UPDATE posttimerconstantprogress SET extra_minutes = " + span.TotalMinutes + " ORDER BY id DESC LIMIT 1; | |
update memorization.chemistry_1 set sub_details_1_15 = xxx where sub_details_1_15 IS NULL | |
# description to stranger # 1. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. UPDATE back_up SET memorization_history = "test" WHERE id = (SELECT min_id FROM (SELECT MIN(id) AS min_id FROM back_up WHERE memorization_history IS NULL) AS back_up) | |
# description to stranger # 1. update increment # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. UPDATE test2 SET test= (test+1) where id = 5 | |
# description to stranger # 1. # 2. # 3. # running condtions: # 1. datae base as specified # 2. table naemd as specified # 3. columns as specified # 4. # 5. # 6. # 7. # example table: # column 1 - # column 2 - # column 3 - # column 4 - # column 5 - # column 6 - # c1 r1 - # c2 r1 - # c3 r1 - # c4 r1 - # c5 r1 - # c6 r1 - UPDATE eyes_creation_steps SET effectiveness = even_better_1/(even_better_1+even_better_2) where even_better_1 <>0 or even_better_2 <>0 | |
UPDATE `History` SET `state`=0 WHERE `Session`=65 ORDER BY `id` DESC LIMIT 1 | |
SELECT * FROM counts_3." + drop_down_value_1 + " where subcategory_1 = + drop_down_value_2 + and subcategory_2 not LIKE "not_yet%" order by rating_1 desc |